<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <title>成长第一课</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    
    <link rel="stylesheet"  type="text/css"  href="/public/weixin/css/mobile_module.css"  media="all"/>
</head>
<body>
	<div class="container body">
    	<div class="p_10 top_line"> 
        	<h5 class="page_title"></h5>
            <!-- 表单 -->
            <form method="post" class="m_15">
              <!-- 基础文档模型 -->
              <input type="hidden" id="uid" name="uid" value="<?php echo ($uid); ?>"/>
              <div id="tab1" class="tab-pane">
              	<div class="block_content_bg">
                  <div class="block_content_top">
                  		<h6><img width="40px" src="/public/weixin/img/card.png"/> 学生安全·道德·法制教育</h6>
                  </div>
                  <div class="p_10">
                      <!-- <span style="color:red;">特别提示：请正确输入卡号密码。一旦输错，系统会自动锁定，解锁很麻烦</span> -->
                      <div class="form-item cf">
                            <label class="item-label">卡号:</label>
                            <div class="controls">
                              <input type="number"  maxlength="7"  placeholder="请输入7位数的卡号"  class="text input-large" name="number" id="number" value="" required>
                            </div>
                       </div>
                       <div class="form-item cf">
                            <label class="item-label">密码:</label>
                            <div class="controls">
                              <input type="password" maxlength="4" placeholder="请输入4位数的密码" class="text input-large" name="password" id="password" value="" required>
                            </div>
                       </div>
                    </div>
                 </div>          
                 <div class="form-item pt_10">
                	<button class="home_btn submit-btn mb_10 flex_1" id="submit" type='button'  target-form="form-horizontal">登  录</button>
                 </div>
          	</div>
            </form>

        </div>
        <p class="copyright" style="text-align: center;font-size: 14px;">Student safety, legal and moral education</p>
    </div>
    <script src="/public/js/jquery-3.1.1.min.js"></script>
    <script src="/public/js/dialog.js"></script>
   <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript">

   $('#submit').click(function(){
			var number=$('#number').val();
			var password=$('#password').val();
			var uid = $('#uid').val();
			if(number!=undefined && number==""){
				$.Dialog.fail("请输入卡号");//成功调用 提示一秒后自动关闭
				return false;
			}
			if(password!=undefined && password==""){
				$.Dialog.fail("请输入密码");//成功调用 提示一秒后自动关闭
				return false;
			}
            var his_url = '<?php echo ($his_url); ?>';
            $('#submit').attr('disabled', 'disabled');
			$.post("<?php echo U('bindCard_ajax');?>",{'number':number,'password':password},function(dd){
				console.info(dd);
				if(dd.status == 1){
                    $('#submit').removeAttr('disabled');
                   /*  $.Dialog.fail(dd.msg); */
                    WeixinJSBridge.call('closeWindow');
                    $.Dialog.fail(data.msg);
                    setTimeout(function(){
                        if(data.his_url){
                            window.location.href= data.his_url;
                        }
                    },200)
				}else{
                    $('#submit').removeAttr('disabled');
                    $.Dialog.fail(dd.msg);
                    return false;
				}
			});
		});
    </script>
</body>
</html>